package cn.gok.testgit;
class Worker{
   private String name;
   private String job;
   private int salary;
    private int months;


    public Worker(String name, String job, int salary) {
        this.name = name;
        this.job = job;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Worker{" +
                "name='" + name + '\'' +
                ", job='" + job + '\'' +
                ", salary=" + salary +
                '}';
    }
   public int doJob(int months){
          this.months=months;
        System.out.println(this.name+"工作了"+this.months+"个月"+",获得"+this.salary+"工资");
        return this.salary;
    }
}
public class test1 {
    public static void main(String[] args) {
      Worker worker =new Worker("陈宝淋","java",5000);
        worker.doJob(12);


    }
}
